package com.cn.serverline.lineicp.workshopPlan.service.impl;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.cn.serverline.lineicp.workshopPlan.entity.PlanLineAssembleSplit;
import com.cn.serverline.lineicp.workshopPlan.mapper.PlanLineAssembleSplitMapper;
import com.cn.serverline.lineicp.workshopPlan.service.IPlanLineAssembleSplitService;
import org.springframework.stereotype.Service;
import cn.stylefeng.roses.kernel.db.api.pojo.page.PageResult;
import cn.hutool.core.bean.BeanUtil;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import cn.hutool.core.util.ObjectUtil;
import cn.stylefeng.roses.kernel.db.api.factory.PageResultFactory;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import cn.stylefeng.roses.kernel.db.api.factory.PageFactory;


/**
 * <p>
 * 周部装组件拆分表 服务实现类
 * </p>
 *
 * @author 田江余
 * @since 2024-08-12
 */
@Service("PlanLineAssembleSplitServiceImpl")
public class PlanLineAssembleSplitServiceImpl extends ServiceImpl<PlanLineAssembleSplitMapper, PlanLineAssembleSplit> implements IPlanLineAssembleSplitService {
    @Override
    public void add(PlanLineAssembleSplit planLineAssembleSplit) {
        this.save(planLineAssembleSplit);
    }

    @Override
    public void del(PlanLineAssembleSplit planLineAssembleSplit) {
        this.removeById(planLineAssembleSplit);
    }

    @Override
    public void edit(PlanLineAssembleSplit planLineAssembleSplit) {
        this.updateById(planLineAssembleSplit);
    }

    @Override
    public PlanLineAssembleSplit detail(PlanLineAssembleSplit planLineAssembleSplit) {
        return this.getById(planLineAssembleSplit);
    }

    @Override
    public PageResult<PlanLineAssembleSplit> findPage(PlanLineAssembleSplit planLineAssembleSplit) {
        LambdaQueryWrapper<PlanLineAssembleSplit> wrapper = new LambdaQueryWrapper<>();
        // 筛选主要属性
        /* wrapper.select(PlanLineAssembleSplit::getId, PlanLineAssembleSplit::getPositionName, PlanLineAssembleSplit::getCode, PlanLineAssembleSplit::getRemark,
        PlanLineAssembleSplit::getPositionSort, BaseEntity::getCreateTime);*/

        Page<PlanLineAssembleSplit> sysRolePage = this.page(PageFactory.defaultPage(), wrapper);
        return PageResultFactory.createPageResult(sysRolePage);
    }
}
